<admintpl file="header" />
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
  <ul class="nav nav-tabs">
     <li class="active">
     <a href="{:U('members/memberslist')}">会员列表</a></li>
  </ul>
  <form class="J_ajaxForm" action="" method="post">
    <div class="table_list">
      <table width="100%" class="table table-hover">
        <thead>
	          <tr>
              <th width="120">&nbsp;&nbsp;&nbsp;&nbsp;ID</th>
              <th>会员名称</th>
              <th>所属行业</th>
              <th>公司地址</th>
              <th>联系电话</th>
	            <th width="120"><span>&nbsp;&nbsp;&nbsp;&nbsp;发布时间</span></th>
	            <th width="120">操作</th>
	          </tr>
        </thead>
         <php>$status=array("3"=>"已审核","2"=>"未审核");</php>
        	<foreach name="mem" item="vo">
	        	<tr>
                <td width="120">{$vo.mid}</td>
                <td width="200"><a href="{:U('product/show',array('id'=>$vo['id']))}" target="_blank">{$vo.mname}</a></td>
                <td width="200">{$vo.htypename}</td>
                <td width="200">{$vo.addr}</td>
                <td width="200">{$vo.tel}</td>
                <!-- <td width="200">{$vo.email}</td> -->
                <!-- <td width="200">{$vo.comm}</td> -->
		            <td>{$vo.createtime}</td>
		            <td width="150">
                  <a href="{:U('members/tuij',array('mid'=>$vo['mid']))}" class="J_Ajax">推荐</a>|
		            	<a href="{:U('members/edit',array('mid'=>$vo['mid'],'id'=>$vo['id']))}" >修改</a>|
                  <a href="{:U('members/delete',array('mid'=>$vo['mid'],'id'=>$vo['id']))}" class="J_ajax_del" >删除</a>|
		            	<a href="{:U('members/cancelaudit',array('id'=>$vo['id'],'mid'=>$vo['mid']))}" class="J_ajax_dialog_btn" data-msg="您确定要取消审核吗？" >取消审核</a>
					      </td>
	          </tr>
          </foreach>
      </table>
    </div>
  </form>
</div>
<script src="__ROOT__/statics/js/common.js{$js_debug}"></script>
<script type="text/javascript">
  $(function(){
     $('a.J_Ajax').on('click', function (e) {
                e.preventDefault();
                var $_this = this,
                    $this = $($_this),
                    href = $this.prop('href'),
                    msg = $this.data('msg');
                if(!msg){
                	msg="您确定要设置成推荐会员吗？";
                }
                art.dialog({
                    title: false,
                    icon: 'question',
                    content: msg,
                    follow: $_this,
                    close: function () {
                        $_this.focus();; //关闭时让触发弹窗的元素获取焦点
                        return true;
                    },
                    ok: function () {
                    	
                        $.getJSON(href).done(function (data) {
                            if (data.state === 'success') {
                                if (data.referer) {
                                    location.href = data.referer;
                                } else {
                                    alert("操作成功!");
                                    $this.text("已推荐");
                                    //reloadPage(window);
                                }
                            } else if (data.state === 'fail') {
                                art.dialog.alert(data.info);
                            }
                        });
                    },
                    cancelVal: '关闭',
                    cancel: true
                });
            });
  })
</script>
</body>
<!-- 靳思远（以后简称J_SY）开发2014-9.25-10.5 -->
</html>